<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>[%$ESPCMS_SOFT_TITLE%]</title>
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_public.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_all.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_framework.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_select.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/upload_file.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/file.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery-ui.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/lngpack_cn.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/bootstrap.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_function.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_form.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_page.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_filetool.js"></script>

		<script type="text/javascript">
			$(document).ready(function () {

				$('.espcms_close_dialog').click(function () {
					parent.closedialogbox();
				});

				$('input[type=checkbox],input[type=radio]').espcms_checkbox();

				$('#file_select_ok_botton').click(function () {
					select_reture();
				});

				loading('ajax_list');
			});

			function select_reture() {
				var select_filelist = $('#select_filelist').val();
				var select_fileurllist = $('#select_fileurllist').val();
				var select_titlelist = $('#select_titlelist').val();
				var select_sizelist = $('#select_sizelist').val();
				var select_extlist = $('#select_extlist').val();
				parent.returnInputFile(select_filelist, select_fileurllist, select_titlelist, select_sizelist, select_extlist);
			}

			function pageselectCallback(listurl, loadname, page_botton, per_page_num, sum_db, sum_page, now_page) {

				var select_id_list = $('#select_id_list').val();
				var select_num = $('#select_num').val();

				var select_id_name_array = new Array();
				if (select_id_list) {

					var select_id_list_array = select_id_list.split(',');
					for (var i = 0; i <= select_id_list_array.length; i++) {
						if (select_id_list_array[i]) {

							select_id_name_array.push('#photoid_' + select_id_list_array[i]);
						}

					}

					select_id_list = select_id_name_array.join(',');
				}

				$("#now_page").val(now_page);

				var sort_key = $('#sort_key').val();
				var sort_rank = $('#sort_rank').val();

				var limit = per_page_num * now_page;
				$.ajax({
					type: "get", url: listurl, data: {'limit': limit, 'per_page_num': per_page_num, 'sort_key': sort_key, 'sort_rank': sort_rank}, global: false,
					beforeSend: function () {
						$('#loadingtable').show();
					},
					success: function (data) {
						$('#loadingtable').hide();
						$(loadname).empty().append(data);

						if (select_id_name_array.length > 0) {
							$(select_id_list).addClass("espcms_fileupload_select");
							$(select_id_list).find('p.file_select_ok').show();
						}

						$('.espcms_fileupload_ok').click(function () {
							var file_id = $(this).attr('id');
							var select_dis = dialog_selectFile(file_id);
							if (select_num == 1 && select_dis) {
								select_reture();
							}
						});
					}
				});
			}
		</script>
	</head>
	<body class="dialog_body">
		<form name="ajax_list" method="post" id="ajax_list">
			<input type="hidden" name="listurl" id="listurl" value="[%$photolist%]"/>
			<input type="hidden" name="loadname" id="loadname" value="#loadingstr"/>
			<input type="hidden" name="page_botton" id="page_botton" value="#page_botton_list"/>

			<input type="hidden" name="sum_select_show" id="sum_select_show" value="0"/>

			<input type="hidden" name="per_page_num" id="per_page_num" value="[%$page_db.per_page_num%]"/>

			<input type="hidden" name="sum_db" id="sum_db" value="[%$page_db.sum_db%]"/>

			<input type="hidden" name="sum_page" id="sum_page" value="[%$page_db.sum_page%]"/>

			<input type="hidden" name="now_page" id="now_page" value="[%$page_db.now_page%]"/>

			<input type="hidden" name="sort_key" id="sort_key" value="file_id"/>

			<input type="hidden" name="sort_rank" id="sort_rank" value="DESC"/>

			<input type="hidden" name="select_num" id="select_num" value="[%$selectnum%]"/>

			<input type="hidden" name="select_id_list" id="select_id_list"/>
			<input type="hidden" name="select_filelist" id="select_filelist"/>
			<input type="hidden" name="select_fileurllist" id="select_fileurllist"/>
			<input type="hidden" name="select_titlelist" id="select_titlelist"/>
			<input type="hidden" name="select_sizelist" id="select_sizelist"/>
			<input type="hidden" name="select_extlist" id="select_extlist"/>
			<div class="upload_botton_list">

				<div class="panel-menu modal-open">
					<div class="right">
						<div class="btn-toolbar" role="toolbar" id="page_botton_list"></div>
					</div>
				</div>
			</div>
			<div id="loadingtable" class="displaynone">
				<span class="espcms_icon_fa espcms_icon_fa-spinner espcms_icon_fa-spin espcms_icon_fa-1x" aria-hidden="true"></span>[%pack:public_pack-espcms_loading_str%]
			</div>
			<div class="panel-body pn" id="loadingstr"></div>

		</form>
		<div class="dialogbotton">
			<div class="dialog_buttonset" id="batuploadbotton">
				<button type="button" id="file_select_ok_botton" class="btn btn-green" style="display: none;">[%pack:botton_pack-espcms_botton_select_ok%]</button>
				<button type="button" class="btn btn-lightgray espcms_close_dialog">[%pack:botton_pack-espcms_botton_close_window%]</button>
			</div>
		</div>
	</body>
</html>
